package cdu.xjj.pojo.entity.basic;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

@Getter
@Setter
@Entity
@Table(name = "tb_chengdu_district")
public class ChengduDistrict {
    @Id
    @Column(name = "id", nullable = false)
    private Long id;

    @Column(name = "district_name", nullable = false)
    private String districtName;

    @Column(name = "district_code", nullable = false)
    private String districtCode;

    @Column(name = "parent_id")
    private Long parentId;

    @ColumnDefault("2")
    @Column(name = "level")
    private Byte level;

    @ColumnDefault("0")
    @Column(name = "sort_order")
    private Integer sortOrder;

    @ColumnDefault("CURRENT_TIMESTAMP")
    @Column(name = "created_at")
    private Instant createdAt;

    @ColumnDefault("CURRENT_TIMESTAMP")
    @Column(name = "updated_at")
    private Instant updatedAt;

}